Skip to content

Conversation

@gordonwoodhull
Copy link
Contributor

Put quarto-html-before-body script really at top at top of body.

We don't have complete control over where Pandoc's 'before body' really is, with so many components contributing to the array via mergeConfigs.

So use an HTML postprocessor for this.

Not sure how to automatically test this, but here is a demo using GitHub Pages.

quarto-web built without this fix
https://gordonwoodhull.github.io/quarto-web-safari-bug/

quarto-web built with this fix
https://gordonwoodhull.github.io/quarto-web-safari-bugless/

we don't have complete control over where 'before body' really is, with so many
components contributing to the array via mergeConfigs

so use a postprocessor for this
@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Apr 9, 2025

This is much better, but still has flashing on some pages. In particular, flashing is likely on the tutorial pages.

EDIT: Not seeing flashing on any pages a day later, probably influenced by caching?

@gordonwoodhull
Copy link
Contributor Author

@cscheid, please test the second website in Safari before merging. I think this is a safe change but can't think of any way to test this automatically.

@cscheid
Copy link
Collaborator

cscheid commented Apr 10, 2025

This is really short and sweet, I like it. I will test it, yeah.

@gordonwoodhull gordonwoodhull merged commit 43c5296 into main Apr 10, 2025
49 checks passed
@gordonwoodhull gordonwoodhull deleted the bugfix/flashing-safari branch April 10, 2025 15:40
@cscheid
Copy link
Collaborator

cscheid commented Apr 10, 2025

Context: the flashing I'm talking about in this message only appears in pages where we have the following combination:

  • dark and light themes
  • additional CSS files

Good news! The flashing is much improved on Safari.

Bad news! The flashing is much worse on Firefox.

I'm investigating.

@gordonwoodhull
Copy link
Contributor Author

Firefox! That's my primary browser.

I see flashes if I mash cmd-R and it can't keep up, but otherwise I see the same behavior as Safari, some flashing on the Get Started tutorials if not cached or cache disabled, have not seen flashing on other pages.

@cscheid
Copy link
Collaborator

cscheid commented Apr 10, 2025

I see the behavior pretty consistently when I:

  • quarto render docs/get-started
  • cd _site; python -m http.server
  • browse http://127.0.0.1:8080/docs/get-started/, then click on the four different pages on the left sidebar

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented Apr 10, 2025

Yeah, exactly, it's the same as the Safari bug but more prominent.

Tested on slow Windows machine. As expected Firefox same but does not cache at all, the three tutorial pages always blink. Chrome and Edge fine of course.

@cscheid
Copy link
Collaborator

cscheid commented Apr 10, 2025

Ugh. It's the redirect we're doing in javascript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants